package player;



import javax.sound.sampled.*;

import java.io.File;


public class Musics {
	private static Clip bgm;
	private static AudioInputStream ais;
	private static AudioInputStream eat;
	public static boolean closeMusics;
	public static void main(String []args)
	{
		
	}
	public static void eatSound()
	{
		if(closeMusics) return ;
			try {
				 bgm=AudioSystem.getClip();
				
				{
					File k=new File("img\\musics\\eat.wav");
					eat=AudioSystem.getAudioInputStream(k);
				}
				bgm.open(eat);
				bgm.start();
			} catch (Exception e) {
				// TODO 自动生成的 catch 块
				e.printStackTrace();
			}
		
	}
	public static void failSound()
	{
		if(closeMusics) return ;
		try {
			 bgm=AudioSystem.getClip();
			
			{
				File k=new File("img\\musics\\fail.wav");
				ais=AudioSystem.getAudioInputStream(k);
			}
			bgm.open(ais);
			bgm.start();
		}catch(Exception e)
		{
			e.printStackTrace();
		}
	}

}
